import unittest,requests
class weidu(unittest.TestCase):
    host='http://10.59.9.18'
    userId=None
    sessionId=None

    #登录 login
    def test_01_login(self):
        url=weidu.host+'/movieApi/user/v2/login'
        json={'email':'1028374179@qq.com','pwd':'eWLPHopE945d2ivttHaQTQ=='}
        login=requests.post(url=url,params=json)
        print(login.json())
        weidu.userId=login.json()['result']['userId']
        weidu.sessionId = login.json()['result']['sessionId']
        print(weidu.userId)
        print(weidu.sessionId)

    # #查询看过的电影 findSeenMovie
    # def test_02_findSeenMovie(self):
    #     url=weidu.host+'/movieApi/user/v2/verify/findSeenMovie'
    #     headers={'userId':str(weidu.userId),'sessionId':weidu.sessionId}
    #     findSeenMovie=requests.get(url=url,headers=headers)
    #     print(findSeenMovie.json())

    #查询热门电影列表 findHotMovieList
    movieId=None
    def test_02_findHotMovieList(self):
        url=weidu.host+'/movieApi/movie/v2/findHotMovieList'
        json={'page':1,'count':5}
        findHotMovieList=requests.get(url=url,params=json)
        print(findHotMovieList.json())
        weidu.movieId=findHotMovieList.json()['result'][0]['movieId']
        print(weidu.movieId)



if __name__ == '__main__':
    unittest.main()